<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>Lightmap</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/Lightmap"> <link href="./mw/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Lightmap rootpage-Lightmap skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main"><span class="mw-page-title-main">Lightmap</span></span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr">
<style data-mw-deduplicate="TemplateStyles:r1305433154">
/* start https://en.wikipedia.org/ */
.mw-parser-output .ambox{border:1px solid #a2a9b1;border-left:10px solid #36c;background-color:#fbfbfb;box-sizing:border-box}.mw-parser-output .ambox+link+.ambox,.mw-parser-output .ambox+link+style+.ambox,.mw-parser-output .ambox+link+link+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+style+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+link+.ambox{margin-top:-1px}html body.mediawiki .mw-parser-output .ambox.mbox-small-left{margin:4px 1em 4px 0;overflow:hidden;width:238px;border-collapse:collapse;font-size:88%;line-height:1.25em}.mw-parser-output .ambox-speedy{border-left:10px solid #b32424;background-color:#fee7e6}.mw-parser-output .ambox-delete{border-left:10px solid #b32424}.mw-parser-output .ambox-content{border-left:10px solid #f28500}.mw-parser-output .ambox-style{border-left:10px solid #fc3}.mw-parser-output .ambox-move{border-left:10px solid #9932cc}.mw-parser-output .ambox-protection{border-left:10px solid #a2a9b1}.mw-parser-output .ambox .mbox-text{border:none;padding:0.25em 0.5em;width:100%}.mw-parser-output .ambox .mbox-image{border:none;padding:2px 0 2px 0.5em;text-align:center}.mw-parser-output .ambox .mbox-imageright{border:none;padding:2px 0.5em 2px 0;text-align:center}.mw-parser-output .ambox .mbox-empty-cell{border:none;padding:0;width:1px}.mw-parser-output .ambox .mbox-image-div{width:52px}@media(min-width:720px){.mw-parser-output .ambox{margin:0 10%}}@media print{body.ns-0 .mw-parser-output .ambox{display:none!important}}
/* end https://en.wikipedia.org/ */
</style>
<p>A <b>lightmap</b> is a <a href="Data_structure" title="Data structure">data structure</a> used in <b>lightmapping</b>, a form of <a href="Surface_caching" class="mw-redirect" title="Surface caching">surface caching</a> in which the brightness of surfaces in a virtual scene is <a href="Baking_(computer_graphics)" class="mw-redirect" title="Baking (computer graphics)">pre-calculated and stored</a> in <a href="Texture_maps" class="mw-redirect" title="Texture maps">texture maps</a> for later use. Lightmaps are most commonly applied to static objects in applications that use <a href="Real-time_computer_graphics" title="Real-time computer graphics">real-time</a> <a href="3D_computer_graphics" title="3D computer graphics">3D computer graphics</a>, such as <a href="Video_game" title="Video game">video games</a>, in order to provide lighting effects such as <a href="Global_illumination" title="Global illumination">global illumination</a> at a relatively low computational cost.
</p>
<meta property="mw:PageProp/toc">
<div class="mw-heading mw-heading2"><h2 id="History">History</h2></div>
<p><a href="John_Carmack" title="John Carmack">John Carmack</a>'s <i><a href="Quake_(video_game)" title="Quake (video game)">Quake</a></i> was the first computer game to use lightmaps to augment <a href="Scanline_rendering" title="Scanline rendering">rendering</a>.<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> Before lightmaps were invented, realtime applications relied purely on <a href="Gouraud_shading" title="Gouraud shading">Gouraud shading</a> to interpolate vertex lighting for surfaces. This only allowed low frequency lighting information, and could create clipping artifacts close to the camera without perspective-correct interpolation. Discontinuity meshing was sometimes used especially with <a href="Radiosity_(computer_graphics)" title="Radiosity (computer graphics)">radiosity</a> solutions to adaptively improve the resolution of vertex lighting information, however the additional cost in primitive setup for realtime rasterization was generally prohibitive. <a href="Quake_(video_game)" title="Quake (video game)">Quake</a>'s software rasterizer used <a href="Surface_caching" class="mw-redirect" title="Surface caching">surface caching</a> to apply lighting calculations in texture space once when polygons initially appear within the <a href="Viewing_frustum" title="Viewing frustum">viewing frustum</a> (effectively creating temporary 'lit' versions of the currently visible textures as the viewer negotiated the scene).
</p><p>As consumer 3d graphics hardware capable of <a href="Multitexturing" class="mw-redirect" title="Multitexturing">multitexturing</a>, light-mapping became more popular, and engines began to combine light-maps in real time as a secondary <a href="Blend_modes#Multiply" title="Blend modes">multiply-blend</a> texture layer.
</p>
<div class="mw-heading mw-heading2"><h2 id="Limitations">Limitations</h2></div>
<p>Lightmaps are composed of <a href="Lumel" class="mw-redirect" title="Lumel">lumels</a><sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> (lumination elements), analogous to texels in <a href="Texture_mapping" title="Texture mapping">texture mapping</a>. Smaller lumels yield a higher <a href="Image_resolution" title="Image resolution">resolution</a> lightmap, providing finer lighting detail at the price of reduced performance and increased memory usage. For example, a lightmap scale of 4 lumels per world unit would give a lower quality than a scale of 16 lumels per world unit. Thus, in using the technique, <a href="Level_design" class="mw-redirect" title="Level design">level designers</a> and <a href="3D_artist" class="mw-redirect" title="3D artist">3d artists</a> often have to make a compromise between performance and quality; if high resolution lightmaps are used too frequently then the application may consume excessive system resources, negatively affecting performance. Lightmap resolution and scaling may also be limited by the amount of disk storage space, bandwidth/download time, or texture memory available to the application. Some implementations attempt to pack multiple lightmaps together in a process known as <i>atlasing</i><sup id="cite_ref-3" class="reference"><a href="#cite_note-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup> to help circumvent these limitations.
</p><p>Lightmap resolution and scale are two different things. The resolution is the area, in pixels, available for storing one or more surface's lightmaps. The number of individual surfaces that can fit on a lightmap is determined by the scale. Lower scale values mean higher quality and more space taken on a lightmap. Higher scale values mean lower quality and less space taken. A surface can have a lightmap that has the same area, so a 1:1 ratio, or smaller, so the lightmap is stretched to fit.
</p><p>Lightmaps in games are usually colored texture maps. They are usually flat, without information about the light's direction, whilst some <a href="Game_engine" title="Game engine">game engines</a> use multiple lightmaps to provide approximate directional information to combine with normal-maps. Lightmaps may also store separate precalculated components of lighting information for semi-dynamic lighting with shaders, such as ambient-occlusion & sunlight shadowing.
</p>
<div class="mw-heading mw-heading2"><h2 id="Creation">Creation</h2></div>
<p>When creating lightmaps, any lighting model may be used, because the lighting is entirely precomputed and real-time performance is not always a necessity. A variety of techniques including <a href="Ambient_occlusion" title="Ambient occlusion">ambient occlusion</a>, direct lighting with sampled shadow edges, and full <a href="Radiosity_(computer_graphics)" title="Radiosity (computer graphics)">radiosity</a><sup id="cite_ref-4" class="reference"><a href="#cite_note-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup> bounce light solutions are typically used. Modern 3D packages include specific plugins for applying light-map UV-coordinates, atlas-ing multiple surfaces into single texture sheets, and rendering the maps themselves. Alternatively game engine pipelines may include custom lightmap creation tools. An additional consideration is the use of compressed <a href="S3_Texture_Compression" title="S3 Texture Compression">DXT</a> textures which are subject to blocking artifacts – individual surfaces must not collide on 4x4 texel chunks for best results.
</p><p>In all cases, <a href="Soft_shadows" class="mw-redirect" title="Soft shadows">soft shadows</a> for static geometry are possible if simple occlusion tests (such as basic <a href="Ray_tracing_(graphics)" title="Ray tracing (graphics)">ray-tracing</a>) are used to determine which lumels are visible to the light. However, the actual softness of the shadows is determined by how the engine interpolates the lumel data across a surface, and can result in a <a href="Pixelation" title="Pixelation">pixelated</a> look if the lumels are too large. See <a href="Texture_filtering" title="Texture filtering">texture filtering</a>.
</p><p>Lightmaps can also be calculated in real-time<sup id="cite_ref-5" class="reference"><a href="#cite_note-5"><span class="cite-bracket">[</span>5<span class="cite-bracket">]</span></a></sup> for good quality colored lighting effects that are not prone to the defects of Gouraud shading, although shadow creation must still be done using another method such as <a href="Stencil_shadow_volumes" class="mw-redirect" title="Stencil shadow volumes">stencil shadow volumes</a> or <a href="Shadow_mapping" title="Shadow mapping">shadow mapping</a>, as real-time ray-tracing is still too slow to perform on modern hardware in most 3D engines.
</p><p><a href="Photon_mapping" title="Photon mapping">Photon mapping</a> can be used to calculate global illumination for light maps.
</p>
<div class="mw-heading mw-heading2"><h2 id="Alternatives">Alternatives</h2></div>
<div class="mw-heading mw-heading3"><h3 id="Vertex_lighting">Vertex lighting</h3></div>
<p>In <b>vertex lighting</b>, lighting information is computed per vertex and stored in <a href="Vertex_color_attributes" class="mw-redirect" title="Vertex color attributes">vertex color attributes</a>. The two techniques may be combined, e.g. vertex color values stored for high detail meshes, whilst light maps are only used for coarser geometry.
</p>
<div class="mw-heading mw-heading3"><h3 id="Discontinuity_mapping">Discontinuity mapping</h3></div>
<p>In <b>discontinuity mapping</b>, the scene may be further <a href="Subdivision_(computer_graphics)" class="mw-redirect" title="Subdivision (computer graphics)">subdivided</a> and <a href="Clipping_(computer_graphics)" title="Clipping (computer graphics)">clipped</a> along major changes in light and dark to better define shadows.
</p>
<div class="mw-heading mw-heading2"><h2 id="See_also">See also</h2></div>
<ul><li><a href="Baking_(computer_graphics)" class="mw-redirect" title="Baking (computer graphics)">Baking (computer graphics)</a></li>
<li><a href="Environment_map" class="mw-redirect" title="Environment map">Environment map</a></li>
<li><a href="Screen_space_ambient_occlusion" title="Screen space ambient occlusion">Screen space ambient occlusion</a></li>
<li><a href="Shader" title="Shader">Shader</a></li>
<li><a href="Texture_mapping" title="Texture mapping">Texture mapping</a></li></ul>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<div class="mw-references-wrap"><ol class="references">
<li id="cite_note-1"><span class="mw-cite-backlink"><b><a href="#cite_ref-1">^</a></b></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1238218222">
/* start https://en.wikipedia.org/ */
.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./mw/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./mw/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./mw/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./mw/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}
/* end https://en.wikipedia.org/ */
</style><cite id="CITEREFAbrash" class="citation web cs1">Abrash, Michael. <a rel="nofollow" class="external text" href="http://www.bluesnews.com/abrash/chap68.shtml">"Quake's Lighting Model: Surface Caching"</a>. <i>Blue's News</i><span class="reference-accessdate">. Retrieved <span class="nowrap">2015-09-07</span></span>.</cite></span>
</li>
<li id="cite_note-2"><span class="mw-cite-backlink"><b><a href="#cite_ref-2">^</a></b></span> <span class="reference-text"><cite id="CITEREFChanna2003" class="citation web cs1">Channa, Keshav (July 21, 2003). <a rel="nofollow" class="external text" href="http://www.flipcode.com/archives/Light_Mapping_Theory_and_Implementation.shtml">"flipcode - Light Mapping - Theory and Implementation"</a>. <i>www.flipcode.com</i><span class="reference-accessdate">. Retrieved <span class="nowrap">2015-09-07</span></span>.</cite></span>
</li>
<li id="cite_note-3"><span class="mw-cite-backlink"><b><a href="#cite_ref-3">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="http://http.download.nvidia.com/developer/NVTextureSuite/Atlas_Tools/Texture_Atlas_Whitepaper.pdf">"Texture Atlasing Whitepaper"</a> <span class="cs1-format">(PDF)</span>. <i>nvidia.com</i>. <a href="NVIDIA" class="mw-redirect" title="NVIDIA">NVIDIA</a>. 2004-07-07<span class="reference-accessdate">. Retrieved <span class="nowrap">2015-09-07</span></span>.</cite></span>
</li>
<li id="cite_note-4"><span class="mw-cite-backlink"><b><a href="#cite_ref-4">^</a></b></span> <span class="reference-text">Jason Mitchell, Gary McTaggart, Chris Green, <a rel="nofollow" class="external text" href="https://steamcdn-a.akamaihd.net/apps/valve/2006/SIGGRAPH06_Course_ShadingInValvesSourceEngine.pdf">Shading in Valve's Source Engine</a>. (<a href="PDF" title="PDF">PDF</a>) Retrieved Jun. 07, 2019.</span>
</li>
<li id="cite_note-5"><span class="mw-cite-backlink"><b><a href="#cite_ref-5">^</a></b></span> <span class="reference-text">November 16, 2003. <a rel="nofollow" class="external text" href="http://joshbeam.com/articles/dynamic_lightmaps_in_opengl/">Dynamic Lightmaps in OpenGL</a>. Joshbeam.com Retrieved Jul. 07, 2014.</span>
</li>
</ol></div></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2025-04-15" href="https://en.wikipedia.org/wiki/?title=Lightmap&oldid=1285782125">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>
</body></html>